import $axios from '@/sever'
// sendUniSMS
export const sendUniSMS = async (phone: string) => {
  return await $axios.post('/users/send-sms', {
    phone
  })
}

// 获取角色列表
export const getRole = async () => {
  return await $axios.get('/users/get-role')
}

// 检查验证码是否正确
export const checkSmsCode = async (phone: string, code: string) => {
  return await $axios.post('/users/check-sms-code', {
    phone,
    smscode: code
  })
}

// 注册
export const register = async (obj: any) => {
  return await $axios.post('/users/register', obj)
}

// 检测用户名是否占用
export const checkUsername = async (username: string) => {
  return await $axios.post('/users/check-username', { username })
}
